package com.ymatou.iapi.m.couponservice.service;

import com.ymatou.iapi.m.couponservice.parameter.ConversionCodes;
import com.ymatou.iapi.m.couponservice.parameter.CouponInfos;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*分页获取指定批次下的优惠券列表信息Call
*FreeMaker Template自动生成代码
*/
public class GetCouponsOfBatchByPagingCall extends YmatouBaseCall{
	private static String opurl ="api/SellerManage/GetCouponsOfBatchByPaging";
	
	public GetCouponsOfBatchByPagingCall() {
		super(EnvSetup.getSystemUrl("couponservice_m"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	/**
	 * 获取Code
	 * 
	 * @return
	 */
	public String getCode() {
		return getString("statusCode");		
	}

	/**
	 * 获取Message
	 * 
	 * @return
	 */
	public String getMessage() {
		return getString("message");	
	}

	/**
	 * 获取Data
	 * 
	 * @return
	 */
	public String getData() {
		return getString("data");	
	}

	public CouponInfos getCouponInfos()
	{
		CouponInfos data = null;
        try {
            data = (CouponInfos) FormatUtil.GSONToObject(getData(), CouponInfos.class);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return data;
	}
}